package com.example.demo.Bean;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

@Data
public class Course implements Serializable {

    @TableId(type = IdType.NONE)
    private String courseId;

    private String name;

    private String description;

    private String teachers;

    @TableField(exist = false)
    private List<String> teacherList = new ArrayList();

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    private Integer isDelete;

    public void setTeachers(String teachers){
        this.teachers = teachers;
        teacherList = Arrays.asList(teachers.split(";"));
    }


}
